Crate hkdf[−][src]
An implementation of HKDF, the HMAC-based Extract-and-Expand Key Derivation Function.
Usage
let ikm = hex::decode("0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b").unwrap(); let salt = hex::decode("000102030405060708090a0b0c").unwrap(); let info = hex::decode("f0f1f2f3f4f5f6f7f8f9").unwrap(); let h = Hkdf::<Sha256>::new(Some(&salt[..]), &ikm); let mut okm = [0u8; 42]; h.expand(&info, &mut okm).unwrap(); println!("OKM is {}", hex::encode(&okm[..]));
Structs
Hkdf | Structure representing the HKDF, capable of HKDF-Expand and HKDF-Extract operations. |
HkdfExtract | Structure representing the streaming context of an HKDF-Extract operation |
InvalidLength | Structure for InvalidLength, used for output error handling. |
InvalidPrkLength | Error that is returned when supplied pseudorandom key (PRK) is not long enough. |